package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: DishFlavorMapper
 * Package: com.sky.mapper
 * Description:
 *
 * @Autehor 屈子岩
 * @Create 2024/9/5 14:52
 * @Version 1.0
 */
@Mapper
public interface DishFlavorMapper {

    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> selcetByDishId(Long id);


    /**
     * 批量插入口味数据
     * @param flavors
     */


    void saveBetch(List<DishFlavor> flavors);


    /**
     * 根据菜品id删除口味数据
     * @param id
     */
    @Delete("delete from dish_flavor where dish_id=#{id}")
    void deleteByDishId(Long id);
}
